let arr = [1, 5, 3, 4, 1, 3 ,2 ];
let myset = new Set();

// for(var k in arr){
//     myset.add(arr[k]);
// }
arr.forEach( item => myset.add(item));

//Set 转为 数组类型
var myArray = [...myset];
console.log(myArray);